SELECT 'sqlserver' AS dbms_type_name,
       CAST (SERVERPROPERTY('ServerName') AS VARCHAR (150)) AS dbms_name,
       CONSTRAINT_CATALOG,
       CONSTRAINT_SCHEMA,
       CONSTRAINT_NAME,
       TABLE_CATALOG,
       TABLE_SCHEMA,
       TABLE_NAME,
       COLUMN_NAME,
       ORDINAL_POSITION,
       getdate() AS LOAD_DTM
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME NOT IN ('dtproperties', 'sysdiagrams')
      AND OBJECTPROPERTY(OBJECT_ID('' + TABLE_SCHEMA + '.' + TABLE_NAME + ''), 'ismsshipped') = 0

